package com.tencent.sr.iris.activity.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 用户下单情况
 */
@AllArgsConstructor
@Getter
public enum UserPaymentTypeEnum {
    NEW("1", "新用户"),
    FIRST_ORDER("2", "首单"),
    SECOND_ORDER("3", "二单"),
    ACTIVE("4", "活跃用户（二单以上）");

    private String code;
    private String desc;

    public static UserPaymentTypeEnum getByCode(String code) {
        for (UserPaymentTypeEnum user : UserPaymentTypeEnum.values()) {
            if (user.getCode().equals(code)) {
                return user;
            }
        }
        return null;
    }
}
